<?php

/**
 * My Application bootstrap file.
 */
use Nette\Application\Routers\Route;
use Nette\Diagnostics\Debugger;

// Load Nette Framework
require LIBS_DIR . '/Nette/loader.php';

// Load WheelDB
require APP_DIR . '/../../../../loader.php'; //(<- demos/prekazky.cz/!/app)
WDB\Config::$source = APP_DIR . '/config/wdb-config.php';


Debugger::enable();
// Configure application
$configurator = new Nette\Config\Configurator;

// Enable Nette Debugger for error visualisation & logging
$configurator->setDebugMode($configurator::AUTO);
$configurator->enableDebugger(__DIR__ . '/../log');

// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()
	->addDirectory(APP_DIR)
	->addDirectory(LIBS_DIR)
	->register();

// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$container = $configurator->createContainer();

// Setup router
$container->router[] = new Route('index.php', 'Home:default', Route::ONE_WAY);

$container->router[] = new Route('koňské_boxy', 'Static:konskeBoxy');
$container->router[] = new Route('vnitřní_boxy', 'Static:vnitrniBoxy');
$container->router[] = new Route('venkovní_boxy', 'Static:venkovniBoxy');
$container->router[] = new Route('mobilní_boxy', 'Static:mobilniBoxy');

$container->router[] = new Route('závodní_materiál', 'Static:zavodniMaterial');
$container->router[] = new Route('zakázková_výroba', 'Static:zakazkovaVyroba');

$container->router[] = new Route('další_služby', 'Static:dalsiSluzby');
$container->router[] = new Route('kontakt', 'Contact:default');

$container->router[] = new Route('tréninkový_materiál',
        array('presenter'=>'Products','action'=>'list','productCategory'=>'trenink'));
$container->router[] = new Route('skokový_materiál',
        array('presenter'=>'Products','action'=>'list','productCategory'=>'skok'));

$container->router[] = new Route('oplůtky',
        array('presenter'=>'Products','action'=>'list','productCategory'=>'oplutky'));
$container->router[] = new Route('písmena',
        array('presenter'=>'Products','action'=>'list','productCategory'=>'pismena'));
$container->router[] = new Route('budky_pro_rozhodčí',
        array('presenter'=>'Products','action'=>'list','productCategory'=>'budky'));
$container->router[] = new Route('drezurní_materiál', 
        array('presenter'=>'Products','action'=>'list','productCategory'=>'drezurni'));

// Under construction routes
$container->router[] = new Route('ve_výstavbě', 'Static:underConstruction');
//$container->router[] = new Route('koňské_boxy', 'Static:underConstruction');
//$container->router[] = new Route('skokový_materiál', 'Static:underConstruction');

$container->router[] = new Route('<presenter>/<action>[/<id>]', 'Home:default');


// Run, Forest, run!
$container->application->run();
